package com.kaifamiao.month03.day0323;

/**
 * 斐波拉契数列
 */
public class Fibonacci {

    public static void main(String[] args) {
            System.out.println(f(10));
    }


    /**
     * 求斐波拉切数列
     * @param num 想求第几个斐波拉切数
     * @return 找到的斐波拉切数
     */
    public static int f(int num){
        if(num == 1 || num == 2)
            return 1;
        return f(num - 1) + f(num - 2);
    }
}
